Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

MARK(from(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(s(X)) → MARK(X)
MARK(length1(X)) → A__LENGTH1(X)
A__LENGTH(cons(X, Y)) → A__LENGTH1(Y)
MARK(cons(X1, X2)) → MARK(X1)
A__FROM(X) → MARK(X)
MARK(length(X)) → A__LENGTH(X)
A__LENGTH1(X) → A__LENGTH(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(from(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(s(X)) → MARK(X)
MARK(length1(X)) → A__LENGTH1(X)
A__LENGTH(cons(X, Y)) → A__LENGTH1(Y)
MARK(cons(X1, X2)) → MARK(X1)
A__FROM(X) → MARK(X)
MARK(length(X)) → A__LENGTH(X)
A__LENGTH1(X) → A__LENGTH(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 2 SCCs with 2 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

A__LENGTH(cons(X, Y)) → A__LENGTH1(Y)
A__LENGTH1(X) → A__LENGTH(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

A__LENGTH(cons(X, Y)) → A__LENGTH1(Y)
A__LENGTH1(X) → A__LENGTH(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MARK(from(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
A__FROM(X) → MARK(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(from(X)) → MARK(X)
MARK(from(X)) → A__FROM(mark(X))
The remaining pairs can at least be oriented weakly.

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
A__FROM(X) → MARK(X)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(A__FROM(x1)) = x1   
POL(MARK(x1)) = x1   
POL(a__from(x1)) = 1 + x1   
POL(a__length(x1)) = 0   
POL(a__length1(x1)) = 0   
POL(cons(x1, x2)) = x1   
POL(from(x1)) = 1 + x1   
POL(length(x1)) = 0   
POL(length1(x1)) = 0   
POL(mark(x1)) = x1   
POL(nil) = 0   
POL(s(x1)) = x1   

The following usable rules [17] were oriented:

mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(nil) → nil
mark(0) → 0
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
a__length1(X) → length1(X)
a__from(X) → from(X)
a__length(X) → length(X)
a__from(X) → cons(mark(X), from(s(X)))
a__length(cons(X, Y)) → s(a__length1(Y))
a__length(nil) → 0



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
A__FROM(X) → MARK(X)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ DependencyGraphProof
QDP
                    ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)

The TRS R consists of the following rules:

a__from(X) → cons(mark(X), from(s(X)))
a__length(nil) → 0
a__length(cons(X, Y)) → s(a__length1(Y))
a__length1(X) → a__length(X)
mark(from(X)) → a__from(mark(X))
mark(length(X)) → a__length(X)
mark(length1(X)) → a__length1(X)
mark(cons(X1, X2)) → cons(mark(X1), X2)
mark(s(X)) → s(mark(X))
mark(nil) → nil
mark(0) → 0
a__from(X) → from(X)
a__length(X) → length(X)
a__length1(X) → length1(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ DependencyGraphProof
                  ↳ QDP
                    ↳ UsableRulesProof
QDP
                        ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: